package com.cee.enums;

import com.cee.util.EnumUtil;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/** @Author: kent long
 *  @Date: 2019/6/20 16:08 */
public enum LastRecTxnType implements BaseEnum<String> {

      I("I", "insert"),
      U("U", "update"),
      D("D", "delete");
      private String code;
      private String text;

      private LastRecTxnType(String code, String text) {
        this.code = code;
        this.text = text;
      }

      public void setCode(String code) {
        this.code = code;
      }

      @Override
      public String getCode() {
        return code;
      }

      @JsonValue
      @Override
      public String getText() {
        return text;
      }
      
      @JsonCreator
      public static LastRecTxnType createEnum(String code) {
          return EnumUtil.getEnumByCode(LastRecTxnType.class, code);
      }
      
}
